package com.example.lirisheng.springbootfinalexperiment.util;

import com.example.lirisheng.springbootfinalexperiment.entity.PersonInformation;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;
import java.util.Map;

public class JSON {

    public static ObjectMapper mapper = new ObjectMapper();

    public static  String writeValue(Object object) throws IOException {
         return mapper.writeValueAsString(object);
    }

    public static  Map<String,Object> readValue(String jsonString) throws IOException {

        return mapper.readValue(jsonString, Map.class);
    }

}
